import request from "@/utils/request";

// 数据列表查询接口
export const dataListService = (queryParams) => {
  // queryParams格式: { pageNum: 1, pageSize: 5, type: "无人机", area: "鸟岛" }
  // 使用POST请求，参数以JSON格式传递
  return request.post('/data/query', queryParams)
}
// 数据删除接口
export const dataDeleteService = (id) => {
  // 以URL参数形式传递id
  return request.delete(`/data/delete?id=${id}`)
}

// 新增数据接口
export const dataSaveService = (data) => {
  return request.post('/data/save', data)
}
export const dataUpdateService = (data) => {
  return request.post('/data/update', data)
}
export const dataQueryService = (id) => {
  // 以URL参数形式传递id
  return request.post(`/data/query`)
}